<template>
  <div class="list">
    <el-breadcrumb>
      <el-breadcrumb-item :to="{path:'/'}">首页</el-breadcrumb-item>
      <el-breadcrumb-item :to="{path:'/bid/list'}">公共列表页</el-breadcrumb-item>
      <el-breadcrumb-item >公共详情页</el-breadcrumb-item>
    </el-breadcrumb>
    <div class="main">
      <h1 style="font-size: 28px;">{{ title }}</h1>
      <div class="publish">
        <span style="color:#333;font-size: 14px;">发布企业：</span>
        <span style="color:#666;font-size: 14px;margin-right: 15px;">{{ publisher }}</span>
        <span style="color:#333;font-size: 14px;">发布时间：</span>
        <span style="color:#666;font-size: 14px;">{{ publishDataTime }}</span>
      </div>
      <div class="bidContent" ref="bidContent" style="text-align: left;"></div>
      <div class="download">
        <ul>
          <template v-for="item in fileList">
            <li @click="download(item.fileName)">
              <span>附件：</span>
              <span>{{ item.fileName }}</span>
            </li>
          </template>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import {getBidding} from '@/api/bid/enterprise'
import {download} from '@/utils/neu'

export default {
  name: "detail",
  methods: {
    downFile(fileName){
      download(fileName)
    }
  },
  data() {
    return {
      id:null,
      title:"",
      publisher:'',
      publishDataTime:'',
      content:'',
      fileList:[],
    }
  },
  async created() {
    this.id=this.$route.query.id
    getBidding(this.id).then(res=>{
      console.log(res);
      this.title= res.data.bidTitle
      this.publisher= res.data.bidPublisher
      this.publishDataTime= this.parseTime(res.data.createTime,'{y}年{m}月{d}日')
      this.content= res.data.bidContent
      this.$refs.bidContent.innerHTML = this.content
      this.fileList= res.data.filesList
    })
  },
  mounted() {
    
  },

}
</script>

<style lang="scss" scoped>
.download{
  ul{
    li{
      text-align: left;
      list-style: none;
      font-size: 14px;
      color: gray;
    }

    li:hover{
      color: #17c2aa;
      cursor: pointer;
    }
  }
}
</style>
